home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / sbe.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  35.8 KB  |  975 lines

  1.  
  2. /*++
  3.  
  4.     Copyright (c) 2002 Microsoft Corporation
  5.  
  6.     Module Name:
  7.  
  8.         sbe.idl
  9.  
  10.     Abstract:
  11.  
  12.         This module the StreamBuffer interface definitions & CLSIDs, public
  13.  
  14. --*/
  15.  
  16. import "unknwn.idl" ;
  17. import "wtypes.idl" ;
  18. import "objidl.idl";
  19. import "strmif.idl" ;
  20.  
  21. //  ============================================================================
  22.  
  23. //  interfaces
  24. interface   IStreamBufferSink ;                     //  get recording objects
  25. interface   IStreamBufferSource ;                   //  associates with IStreamBufferSink
  26. interface   IStreamBufferRecordControl ;            //  recording control
  27. interface   IStreamBufferRecordingAttribute ;       //  StreamBuffer attribute creation
  28. interface   IEnumStreamBufferRecordingAttrib ;      //  StreamBuffer attribute enumeration
  29. interface   IStreamBufferConfigure ;                //  configuration interface
  30. interface   IStreamBufferMediaSeeking ;             //  IMediaSeeking but with different GUID
  31. interface   IStreamBufferPolicy ;                   //  StreamBuffer policies
  32. interface   IStreamBufferInitialize ;               //  allows 3rd party app to set HKEY
  33.  
  34. [
  35.     object,
  36.     uuid(9ce50f2d-6ba7-40fb-a034-50b1a674ec78),
  37.     pointer_default(unique)
  38. ]
  39. [local] interface IStreamBufferInitialize : IUnknown
  40. {
  41.     /*++
  42.         ------------------------------------------------------------------------
  43.         SetHKEY ()
  44.  
  45.         Implemented on StreamBufferStreamSink and StreamBufferSource filters.
  46.         Gives a hosting application the ability to specify HKEY root in
  47.           registry.  This method must called **early**: after the filter is
  48.           instantiated, but before StreamBufferSource is locked (explicitly or
  49.           implicitely) if calling the method on StreamBufferSource, or before
  50.           a source is set (via IStreamBufferSource or IFileSourceFilter) if
  51.           calling the method on StreamBufferStreamSource.  If a call is made
  52.           after either filter has been initialized internally, the call will
  53.           fail with E_UNEXPECTED.  The hosting application is responsible for
  54.           ensuring that the HKEY passed in is writable & readable per the
  55.           logged-on user privileges.  The HKEY is duplicated internally,
  56.           so the caller can close it after making this call.
  57.     --*/
  58.     HRESULT
  59.     SetHKEY (
  60.         [in]    HKEY    hkeyRoot
  61.         ) ;
  62.  
  63.     /*++
  64.         ------------------------------------------------------------------------
  65.         SetSIDs ()
  66.  
  67.         Implemented on StreamBufferStreamSink and StreamBufferSource filters.
  68.         Provides a way for the hosting application to specify security-level
  69.           sharing between capture and render processes and contexts.  By
  70.           default security attributes are inherited from the hosting process,
  71.           unless the application overrides the defaults and provides them via
  72.           this method.
  73.     --*/
  74.     HRESULT
  75.     SetSIDs (
  76.         [in]                    DWORD   cSIDs,
  77.         [in, size_is (cSIDs)]   PSID *  ppSID
  78.         ) ;
  79. } ;
  80.  
  81. /*++
  82.     ============================================================================
  83.     ============================================================================
  84.     IStreamBufferSink
  85.  
  86.     Stream Source interface;
  87.     implemented on the StreamBufferSink filter;
  88.     Only way to get a recorder object's IUnknown (object will subsequently
  89.         be associated with this Sink)
  90. --*/
  91.  
  92. enum {
  93.     RECORDING_TYPE_CONTENT = 0,         //  no post-recording or overlapped
  94.     RECORDING_TYPE_REFERENCE,           //  allows post-recording & overlapped
  95. } ;
  96.  
  97. [
  98.     object,
  99.     uuid(afd1f242-7efd-45ee-ba4e-407a25c9a77a),
  100.     pointer_default(unique)
  101. ]
  102. interface IStreamBufferSink : IUnknown
  103. {
  104.     /*++
  105.         ------------------------------------------------------------------------
  106.         LockProfile ()
  107.  
  108.         1.  Locks the profile;
  109.         2.  No *new* input pin connections will be accepted;
  110.         3.  Existing pins that are, or have ever been, connected can be
  111.             reconnected if the media type is exactly the same as the first
  112.             successful connection;
  113.         4.  Can be called multiple times safely with NULL parameter, but only
  114.             once with non-NULL parameter; returns E_UNEXPECTED if called more
  115.             than once with non-NULL param, or after the hosting filter has run;
  116.         5.  Must be called before the filter that implements this interface is
  117.             ever run; when it is run, it locks implicitely and this method has
  118.             no effect if called with NULL parameters, or fails if called with
  119.             non-NULL parameter for the reasons listed above;
  120.         6.  Errors with VFW_E_UNSUPPORTED_STREAM if there are no streams in the
  121.             profile;
  122.  
  123.         Parameter Detail
  124.         ----------------
  125.  
  126.         pszStreamBufferFilename
  127.  
  128.             Is a NULL-terminated filename string.  If the content written by
  129.             this sink is to be shared cross-process, this parameter specifies a
  130.             filename that will be opened by any reader(s) to read & render the
  131.             content sent into the sink.
  132.  
  133.             Can be NULL (not specified)
  134.  
  135.             Must be a full-path filename; if no path is specified, the file is
  136.             created in a "current" directory
  137.  
  138.             If the file already exists, the call fails
  139.  
  140.             Is opened with DELETE_ON_CLOSE flag, so is automatically deleted
  141.             when the sink is unlocked, or when the hosting process terminates
  142.     --*/
  143.     HRESULT
  144.     LockProfile (
  145.         [in]    LPCWSTR pszStreamBufferFilename
  146.         ) ;
  147.  
  148.     /*++
  149.         ------------------------------------------------------------------------
  150.         CreateRecorder ()
  151.  
  152.         1.  Returns a *new* recorder object's IUnknown;
  153.         2.  Caller can call QueryInterface() on the returned pointer to get
  154.             interface pointers to configure & control the recording;
  155.         3.  Returned IUnknown pointer is ref'd & must be Release()'d by the
  156.             caller
  157.         4.  IStreamBufferSink interface must have been locked (explicitely or
  158.             implicitely) prior to call
  159.  
  160.         To create an ordinary recording, specify RECORDING_TYPE_CONTENT for the
  161.         dwRecordType parammeter.  This will record the content directly into
  162.         the specified file.  These recording types only accept start and stop
  163.         times that occur in the future.
  164.  
  165.         A recording of type RECORDING_TYPE_REFERENCE generates a small file
  166.         that references content saved in temporary storage.  Recordings of this
  167.         type can have start and stop times that occurs in the past, and can
  168.         overlap other same-type recordings.
  169.  
  170.         Reference recording *content* will be saved in the same subdirectory as
  171.         the specified reference file, but with hidden and system attributes.
  172.         The naming convention of the files will append a _1.sbe, _2.sbe, etc...
  173.         to the filename (minus extension) specified in the call e.g. a
  174.         "seinfeld01.sbe" reference file will have saved content in hidden
  175.         and system files "seinfeld01_1.sbe", "seinfeld01_2.sbe", etc...
  176.  
  177.     --*/
  178.     HRESULT
  179.     CreateRecorder (
  180.         [in]    LPCWSTR     pszFilename,
  181.         [in]    DWORD       dwRecordType,       //  RECORDING_TYPE_CONTENT or RECORDING_TYPE_REFERENCE
  182.         [out]   IUnknown ** pRecordingIUnknown
  183.         ) ;
  184.  
  185.     /*++
  186.         ------------------------------------------------------------------------
  187.         IsProfileLocked ()
  188.  
  189.         1.  Returns S_OK if the profile is locked and S_FALSE if it is not.
  190.         2.  Returns E_FAIL on error.
  191.     --*/
  192.     HRESULT
  193.     IsProfileLocked (
  194.         ) ;
  195. } ;
  196.  
  197. /*++
  198.     ============================================================================
  199.     ============================================================================
  200.     IStreamBufferSource ()
  201.  
  202.     Stream Source reader interface;
  203.     Implemented on the StreamBufferSource filter;
  204. --*/
  205. [
  206.     object,
  207.     uuid(1c5bd776-6ced-4f44-8164-5eab0e98db12),
  208.     pointer_default(unique)
  209. ]
  210. interface IStreamBufferSource : IUnknown
  211. {
  212.     /*++
  213.         ------------------------------------------------------------------------
  214.         SetStreamSink ()
  215.  
  216.         1.  Sets the StreamBuffer Sink that streams from this Source;
  217.         2.  IStreamBufferSink object must be in the same process as this object;
  218.         3.  Interface is AddRef()'d if the call succeeds;
  219.  
  220.         Parameter Detail
  221.         ----------------
  222.  
  223.         pIStreamBufferSink
  224.  
  225.             Sink that will stream to this Source
  226.     --*/
  227.     HRESULT
  228.     SetStreamSink (
  229.         [in]    IStreamBufferSink *    pIStreamBufferSink
  230.         ) ;
  231. } ;
  232.  
  233. /*++
  234.     ============================================================================
  235.     ============================================================================
  236.     IStreamBufferRecordControl
  237.  
  238.     obtained by QIing IStreamBufferSink::CreateRecorder()-returned IUnknown *
  239. --*/
  240. [
  241.     object,
  242.     uuid(ba9b6c99-f3c7-4ff2-92db-cfdd4851bf31),
  243.     pointer_default(unique)
  244. ]
  245. interface IStreamBufferRecordControl : IUnknown
  246. {
  247.     /*++
  248.         ------------------------------------------------------------------------
  249.         Start ()
  250.  
  251.         1.  Starts a recording;
  252.         2.  Will save to the filename that is specified when this interface's
  253.             IUnknown is requested (IStreamBufferSink::CreateRecorder());
  254.  
  255.         Parameter Detail
  256.         ----------------
  257.  
  258.         rtStart
  259.  
  260.             Start time relative to "now;
  261.  
  262.             If the recording type is a content recording, can only refer to
  263.             seconds in the future; allowed seconds are [0,5]
  264.  
  265.             If the recording type is a reference recording, can refer to any
  266.             time that still has valid content i.e. content that has not yet
  267.             become stale
  268.  
  269.             If the recording is a reference recording and (* prtStart) is
  270.             earlier than the earliest still-valid content, the call will reset
  271.             it to the earliest content; the value when the recording was
  272.             actually started will be [out]
  273.     --*/
  274.     HRESULT
  275.     Start (
  276.         [in,out]    REFERENCE_TIME *    prtStart
  277.         ) ;
  278.  
  279.     /*++
  280.         ------------------------------------------------------------------------
  281.         Stop ()
  282.  
  283.         1.  Stops a recording;
  284.         2.  Closes out the file;
  285.  
  286.         Parameter Detail
  287.         ----------------
  288.  
  289.         rtStart
  290.  
  291.             Stop time relative to "now;
  292.  
  293.             If the recording type is a content recording, can only refer to
  294.             seconds in the future; allowed seconds are [0,5]
  295.  
  296.             If the recording type is a reference recording, can refer to any
  297.             time that still has valid content i.e. content that has not yet
  298.             become stale; stop time cannot be <= start time
  299.     --*/
  300.     HRESULT
  301.     Stop (
  302.         [in]    REFERENCE_TIME  rtStop
  303.         ) ;
  304.  
  305.     /*++
  306.         ------------------------------------------------------------------------
  307.         GetRecordingStatus ()
  308.  
  309.         1.  Retrieves the status of the recording
  310.  
  311.         Parameter Detail
  312.         ----------------
  313.  
  314.         phResult
  315.  
  316.             The (current) status of writing or closing the recording file;
  317.  
  318.             Can be NULL;
  319.  
  320.         pbStarted
  321.  
  322.             If supplied, set to a non-zero value if the recording has been
  323.             started
  324.  
  325.             Can be NULL;
  326.  
  327.         pbStopped
  328.  
  329.             If supplied, set to a non-zero value if the recording has been
  330.             stopped;
  331.  
  332.             Can be NULL;
  333.  
  334.         NOTE: If the recording has never been started, it will not be flagged
  335.                 as stopped.
  336.  
  337.     --*/
  338.     HRESULT
  339.     GetRecordingStatus (
  340.         [out] HRESULT * phResult,
  341.         [out] BOOL *    pbStarted,
  342.         [out] BOOL *    pbStopped
  343.         ) ;
  344. } ;
  345.  
  346. /*++
  347.     ============================================================================
  348.     ============================================================================
  349.     IStreamBufferRecComp
  350.  
  351.     CoCreateInstance CLSID_StreamBufferComposeRecording and QueryInterface for
  352.     this interface; this interface allows the creation of a single target
  353.     content recording which consists of a number of concatenated recordings
  354.     (reference or content; can mix & match if desired)
  355. --*/
  356.  
  357. [
  358.     object,
  359.     uuid(9E259A9B-8815-42ae-B09F-221970B154FD),
  360.     pointer_default(unique)
  361. ]
  362. interface IStreamBufferRecComp : IUnknown
  363. {
  364.     /*++
  365.         ------------------------------------------------------------------------
  366.         Initialize ()
  367.  
  368.         1. Initializes for a target recording
  369.  
  370.         Parameter Detail
  371.         ----------------
  372.  
  373.         pszTargetFilename
  374.  
  375.             Sets the target filename
  376.  
  377.             Fails if the file already exists
  378.  
  379.         pszSBRecProfileRef
  380.  
  381.             Must be a completed, SBE-generated recording
  382.  
  383.             This recording's profile will be used to define the target profile
  384.  
  385.             Appended files must have exactly the same profile
  386.     --*/
  387.     HRESULT
  388.     Initialize (
  389.         [in]    LPCWSTR pszTargetFilename,
  390.         [in]    LPCWSTR pszSBRecProfileRef
  391.         ) ;
  392.  
  393.     /*++
  394.         ------------------------------------------------------------------------
  395.         Append ()
  396.  
  397.         1.  appends an entire recording
  398.         2.  fails if the recording is live
  399.     --*/
  400.     HRESULT
  401.     Append (
  402.         [in]    LPCWSTR pszSBRecording
  403.         ) ;
  404.  
  405.     /*++
  406.         ------------------------------------------------------------------------
  407.         AppendEx ()
  408.  
  409.         1.  appends the specified portion of the recording; the parameters must
  410.             be accurate; the call will not readjust them within the boundaries
  411.         2.  the time spread must be at least 2 seconds
  412.         3.  fails if the recording is live
  413.     --*/
  414.     HRESULT
  415.     AppendEx (
  416.         [in]    LPCWSTR         pszSBRecording,
  417.         [in]    REFERENCE_TIME  rtStart,
  418.         [in]    REFERENCE_TIME  rtStop
  419.         ) ;
  420.  
  421.     /*++
  422.         ------------------------------------------------------------------------
  423.         GetCurrentLength ()
  424.  
  425.         1.  returns the current length of the recording; updates as recordings
  426.             are appended;
  427.         2.  can be called repeatedly during a Append() call on another
  428.             thread;
  429.     --*/
  430.     HRESULT
  431.     GetCurrentLength (
  432.         [out]   DWORD * pcSeconds
  433.         ) ;
  434.  
  435.     /*++
  436.         ------------------------------------------------------------------------
  437.         Close ()
  438.  
  439.         1.  explicitely closes the recording
  440.  
  441.         2.  final release of interface closes the recording as well
  442.     --*/
  443.     HRESULT
  444.     Close (
  445.         ) ;
  446.  
  447.     /*++
  448.         ------------------------------------------------------------------------
  449.         Cancel ()
  450.  
  451.         1.  cancels an in-progress appending operation; has no effect otherwise
  452.     --*/
  453.     HRESULT
  454.     Cancel (
  455.         ) ;
  456. } ;
  457.  
  458. /*++
  459.     ============================================================================
  460.     ============================================================================
  461.     IStreamBufferRecordingAttribute
  462.  
  463.     obtained by calling QueryInterface on a recorder
  464.  
  465.     well-known attributes:
  466.  
  467.         NAME                DESCRIPTION
  468.         ------------------- ----------------------------------------------------
  469.  
  470.         Title               String containing the content title.
  471.  
  472.         Author              String containing the name of the content author.
  473.  
  474.         Description         String containing a description of the content.
  475.  
  476.         Rating              String containing a content rating.
  477.  
  478.         Copyright           String containing a content copyright message.
  479.  
  480.         Duration            Quadruple word value containing the playing duration
  481.                                 of the file, in 100-nanosecond units.
  482.  
  483.         Bitrate             Double word value containing the bit rate.
  484.  
  485.         Seekable            Boolean value; true denoting that the content is
  486.                                 seekable.
  487.  
  488.         Stridable           Boolean value, true denoting that the content is
  489.                                 stridable (fast forward and rewind are enabled).
  490.  
  491.         Broadcast           Boolean value; true denoting that the content is not
  492.                                 copyright-protected, and can be broadcast.
  493.  
  494.         Use_DRM             reserved
  495.  
  496.         DRM_Flags           reserved
  497.  
  498.         DRM_Level           reserved
  499.  
  500.         Is_Protected        reserved
  501.  
  502.         Is_Trusted          reserved
  503.  
  504.         Signature_Name      reserved
  505.  
  506.         HasAudio            Boolean, true denoting the content includes an
  507.                                 audio stream.
  508.  
  509.         HasImage            Boolean, true denoting the content includes a still
  510.                                 image stream (such as JPEG images).
  511.  
  512.         HasScript           Boolean, true denoting the content includes a script
  513.                                 stream.
  514.  
  515.         HasVideo            Boolean, true denoting the content includes a video
  516.                                 stream.
  517.  
  518.         CurrentBitrate      Double word containing the current total bitrate,
  519.                                 usually used for MEB (multi-bit rate) streams.
  520.  
  521.         OptimalBitrate      Double word containing the minimum total bitrate
  522.                                 recommended to stream the content and get
  523.                                 maximum quality.
  524.  
  525.         WM/AlbumTitle       String containing the album title.
  526.  
  527.         WM/Track            Double word containing the track number.
  528.  
  529.         WM/PromotionURL     String with a URL to an HTML page that contains
  530.                                 information about products and events (such as
  531.                                 concerts) that are related to this music.
  532.  
  533.         WM/AlbumCoverURL    String with a URL to an HTML page that contains an
  534.                                 image of the album cover and information about
  535.                                 the album.
  536.  
  537.         WM/Genre            String with the genre of the music.
  538.  
  539.         WM/Year             String with the year of publication of the music.
  540.  
  541.         WM/GenreID
  542.  
  543.         WM/MCDI
  544.  
  545.         BannerImageType     One member of the WMT_ATTR_IMAGETYPE enumeration
  546.                                 type.
  547.  
  548.         BannerImageData     The actual image data: a bitmap, JPEG, or GIF image.
  549.  
  550.  
  551.         BannerImageURL      If the banner image is clicked on then this URL is
  552.                                 activated.
  553.  
  554.         CopyrightURL        An URL to a copyright page.
  555.  
  556.         NSC_Name            String containing the multicast station contact
  557.                                 name (read-only).
  558.  
  559.         NSC_Address         String containing the multicast station contact
  560.                                 address (read-only).
  561.  
  562.         NSC_Phone           String containing the multicast station contact
  563.                                 phone number (read-only).
  564.  
  565.         NSC_Email           String containing the multicast station contact
  566.                                 email address (read-only).
  567.  
  568.         NSC_Description     String containing the multicast station contact
  569.                                 description (read-only).
  570.  
  571. --*/
  572.  
  573. cpp_quote( "////////////////////////////////////////////////////////////////" )
  574. cpp_quote( "//" )
  575. cpp_quote( "// List of pre-defined attributes " )
  576. cpp_quote( "//" )
  577. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingDuration[] =L\"Duration\";" )
  578. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBitrate[] =L\"Bitrate\";" )
  579. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSeekable[] =L\"Seekable\";" )
  580. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingStridable[] =L\"Stridable\";" )
  581. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBroadcast[] =L\"Broadcast\";" )
  582. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingProtected[] =L\"Is_Protected\";" )
  583. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrusted[] =L\"Is_Trusted\";" )
  584. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSignature_Name[] =L\"Signature_Name\";" )
  585. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasAudio[] =L\"HasAudio\";" )
  586. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasImage[] =L\"HasImage\";" )
  587. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasScript[] =L\"HasScript\";" )
  588. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasVideo[] =L\"HasVideo\";" )
  589. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCurrentBitrate[] =L\"CurrentBitrate\";" )
  590. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingOptimalBitrate[] =L\"OptimalBitrate\";" )
  591. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasAttachedImages[] =L\"HasAttachedImages\";" )
  592. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSkipBackward[] =L\"Can_Skip_Backward\";" )
  593. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSkipForward[] =L\"Can_Skip_Forward\";" )
  594. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNumberOfFrames[] =L\"NumberOfFrames\";" )
  595. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingFileSize[] =L\"FileSize\";" )
  596. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasArbitraryDataStream[] =L\"HasArbitraryDataStream\";" )
  597. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasFileTransferStream[] =L\"HasFileTransferStream\";" )
  598. cpp_quote( "" )
  599. cpp_quote( "////////////////////////////////////////////////////////////////" )
  600. cpp_quote( "//" )
  601. cpp_quote( "// The content description object supports 5 basic attributes." )
  602. cpp_quote( "//" )
  603. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTitle[] =L\"Title\";" )
  604. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAuthor[] =L\"Author\";" )
  605. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingDescription[] =L\"Description\";" )
  606. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingRating[] =L\"Rating\";" )
  607. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCopyright[] =L\"Copyright\";" )
  608. cpp_quote( "" )
  609. cpp_quote( "////////////////////////////////////////////////////////////////" )
  610. cpp_quote( "//" )
  611. cpp_quote( "// These attributes are used to configure DRM using IWMDRMWriter::SetDRMAttribute." )
  612. cpp_quote( "//" )
  613. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingUse_DRM = L\"Use_DRM\";" )
  614. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingDRM_Flags = L\"DRM_Flags\";" )
  615. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingDRM_Level = L\"DRM_Level\";" )
  616. cpp_quote( "" )
  617. cpp_quote( "////////////////////////////////////////////////////////////////" )
  618. cpp_quote( "//" )
  619. cpp_quote( "// These are the additional attributes defined in the WM attribute" )
  620. cpp_quote( "// namespace that give information about the content." )
  621. cpp_quote( "//" )
  622. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumTitle[] =L\"WM/AlbumTitle\";" )
  623. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrack[] =L\"WM/Track\";" )
  624. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingPromotionURL[] =L\"WM/PromotionURL\";" )
  625. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumCoverURL[] =L\"WM/AlbumCoverURL\";" )
  626. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingGenre[] =L\"WM/Genre\";" )
  627. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingYear[] =L\"WM/Year\";" )
  628. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingGenreID[] =L\"WM/GenreID\";" )
  629. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingMCDI[] =L\"WM/MCDI\";" )
  630. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingComposer[] =L\"WM/Composer\";" )
  631. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingLyrics[] =L\"WM/Lyrics\";" )
  632. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrackNumber[] =L\"WM/TrackNumber\";" )
  633. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingToolName[] =L\"WM/ToolName\";" )
  634. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingToolVersion[] =L\"WM/ToolVersion\";" )
  635. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingIsVBR[] =L\"IsVBR\";" )
  636.  
  637. //
  638. // WM/AlbumArtist is a potentially different value than Author
  639. //
  640. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumArtist[] =L\"WM/AlbumArtist\";" )
  641. cpp_quote( "" )
  642.  
  643. cpp_quote( "////////////////////////////////////////////////////////////////" )
  644. cpp_quote( "//" )
  645. cpp_quote( "// These optional attributes may be used to give information " )
  646. cpp_quote( "// about the branding of the content." )
  647. cpp_quote( "//" )
  648. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageType[] =L\"BannerImageType\";" )
  649. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageData[] =L\"BannerImageData\";" )
  650. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageURL[] =L\"BannerImageURL\";" )
  651. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCopyrightURL[] =L\"CopyrightURL\";" )
  652.  
  653. cpp_quote( "////////////////////////////////////////////////////////////////" )
  654. cpp_quote( "//" )
  655. cpp_quote( "// Optional attributes, used to give information " )
  656. cpp_quote( "// about video stream properties." )
  657. cpp_quote( "//" )
  658. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAspectRatioX[] =L\"AspectRatioX\";" )
  659. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAspectRatioY[] =L\"AspectRatioY\";" )
  660.  
  661. cpp_quote( "////////////////////////////////////////////////////////////////" )
  662. cpp_quote( "//" )
  663. cpp_quote( "// The NSC file supports the following attributes." )
  664. cpp_quote( "//" )
  665. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCName[] =L\"NSC_Name\";" )
  666. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCAddress[] =L\"NSC_Address\";" )
  667. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCPhone[] =L\"NSC_Phone\";" )
  668. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCEmail[] =L\"NSC_Email\";" )
  669. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCDescription[] =L\"NSC_Description\";" )
  670. cpp_quote( "" )
  671.  
  672. //
  673. // StreamBuffer Attribute datatypes;
  674. //
  675. typedef enum {
  676.     STREAMBUFFER_TYPE_DWORD  = 0,
  677.     STREAMBUFFER_TYPE_STRING = 1,
  678.     STREAMBUFFER_TYPE_BINARY = 2,
  679.     STREAMBUFFER_TYPE_BOOL   = 3,
  680.     STREAMBUFFER_TYPE_QWORD  = 4,
  681.     STREAMBUFFER_TYPE_WORD   = 5,
  682.     STREAMBUFFER_TYPE_GUID   = 6,
  683. } STREAMBUFFER_ATTR_DATATYPE ;
  684.  
  685. [
  686.     object,
  687.     uuid(16CA4E03-FE69-4705-BD41-5B7DFC0C95F3),
  688.     pointer_default(unique)
  689. ]
  690. interface IStreamBufferRecordingAttribute : IUnknown
  691. {
  692.     /*++
  693.         ------------------------------------------------------------------------
  694.         SetAttribute ()
  695.  
  696.         1.  Sets an attribute on a recording object;
  697.         2.  Fails if the IStreamBufferRecordControl::Start has already been successfully
  698.             called;
  699.         3.  If an attribute of the same name already exists, overwrites the old;
  700.     --*/
  701.     HRESULT
  702.     SetAttribute (
  703.         [in]    ULONG                       ulReserved,
  704.         [in]    LPCWSTR                     pszAttributeName,
  705.         [in]    STREAMBUFFER_ATTR_DATATYPE  StreamBufferAttributeType,
  706.         [in]    BYTE *                      pbAttribute,
  707.         [in]    WORD                        cbAttributeLength
  708.         ) ;
  709.  
  710.     /*++
  711.         ------------------------------------------------------------------------
  712.         GetAttributeCount ()
  713.  
  714.         1.  Returns the count of attributes currently set;
  715.     --*/
  716.     HRESULT
  717.     GetAttributeCount (
  718.         [in]    ULONG   ulReserved,
  719.         [out]   WORD *  pcAttributes
  720.         ) ;
  721.  
  722.     /*++
  723.         ------------------------------------------------------------------------
  724.         GetAttributeByName ()
  725.  
  726.         1.  Given a name, returns the attribute data;
  727.         2.  If the provided buffer is too small, returns VFW_E_BUFFER_OVERFLOW,
  728.             and (* pcbLength) contains the minimum required length of the buffer
  729.         3.  To learn the length of the attribute, pass in non-NULL pcbLength,
  730.             and NULL pbAttribute parameter; [out] value will be the length of
  731.             the attribute
  732.     --*/
  733.     HRESULT
  734.     GetAttributeByName (
  735.         [in]        LPCWSTR                         pszAttributeName,
  736.         [in]        ULONG *                         pulReserved,
  737.         [out]       STREAMBUFFER_ATTR_DATATYPE *    pStreamBufferAttributeType,
  738.         [out]       BYTE *                          pbAttribute,
  739.         [in, out]   WORD *                          pcbLength
  740.         ) ;
  741.  
  742.     /*++
  743.         ------------------------------------------------------------------------
  744.         GetAttributeByIndex ()
  745.  
  746.         1.  Given an 0-based index, returns the attribute name and data
  747.         2.  If either buffer is too small, returns VFW_E_BUFFER_OVERFLOW, and
  748.             (* pcbLength) and (* pcchNameLength) contain the minimum required
  749.             length of each buffer
  750.         3.  The length returned by pcchNameLength includes the null-terminator
  751.         4.  To learn the length of the name & attribute, pass in non-NULL
  752.             pcchNameLength & pcbLength, and NULL pszAttributeName & pbAttribute
  753.             parameters; [out] value of the non-NULL parameters will be the
  754.             lengths of the name and attribute
  755.     --*/
  756.     HRESULT
  757.     GetAttributeByIndex (
  758.         [in]        WORD                            wIndex,
  759.         [in]        ULONG *                         pulReserved,
  760.         [out]       WCHAR *                         pszAttributeName,
  761.         [in, out]   WORD *                          pcchNameLength,         //  includes NULL-terminator; in BYTES
  762.         [out]       STREAMBUFFER_ATTR_DATATYPE *    pStreamBufferAttributeType,
  763.         [out]       BYTE *                          pbAttribute,
  764.         [in, out]   WORD *                          pcbLength
  765.         ) ;
  766.  
  767.     /*++
  768.         ------------------------------------------------------------------------
  769.         EnumAttributes ()
  770.  
  771.         1.  Returns a StreamBuffer attribute enumeration object that snapshots
  772.             the attributes at time-of-call
  773.     --*/
  774.     HRESULT
  775.     EnumAttributes (
  776.         [out]   IEnumStreamBufferRecordingAttrib **     ppIEnumStreamBufferAttrib
  777.         ) ;
  778. } ;
  779.  
  780. /*++
  781.     ============================================================================
  782.     ============================================================================
  783.     IEnumStreamBufferRecordingAttrib
  784.  
  785.     obtained by calling IStreamBufferRecordingAttribute::EnumAttributes, or
  786.     calling clone on this interface
  787. --*/
  788.  
  789. typedef struct {
  790.     LPWSTR                      pszName ;                   //  allocated by callee; freed by caller
  791.     STREAMBUFFER_ATTR_DATATYPE  StreamBufferAttributeType ;
  792.     BYTE *                      pbAttribute ;               //  allocated by callee; freed by caller
  793.     WORD                        cbLength ;
  794. } STREAMBUFFER_ATTRIBUTE ;
  795.  
  796. [
  797.     object,
  798.     uuid (C18A9162-1E82-4142-8C73-5690FA62FE33),
  799.     pointer_default(unique)
  800. ]
  801. interface IEnumStreamBufferRecordingAttrib : IUnknown
  802. {
  803.     HRESULT
  804.     Next (
  805.         [in]                            ULONG                       cRequest,
  806.         [in, out, size_is (cRequest)]   STREAMBUFFER_ATTRIBUTE *    pStreamBufferAttribute,
  807.         [out]                           ULONG *                     pcReceived
  808.         ) ;
  809.  
  810.     HRESULT
  811.     Skip (
  812.         [in]    ULONG   cRecords
  813.         ) ;
  814.  
  815.     HRESULT
  816.     Reset (
  817.         ) ;
  818.  
  819.     HRESULT
  820.     Clone (
  821.         [out]   IEnumStreamBufferRecordingAttrib **  ppIEnumStreamBufferAttrib
  822.         ) ;
  823. } ;
  824.  
  825. /*++
  826.     ============================================================================
  827.     ============================================================================
  828.     IStreamBufferConfigure
  829.  
  830. --*/
  831. [
  832.     object,
  833.     uuid(ce14dfae-4098-4af7-bbf7-d6511f835414),
  834.     pointer_default(unique)
  835. ]
  836. interface IStreamBufferConfigure : IUnknown
  837. {
  838.     /*++
  839.         ------------------------------------------------------------------------
  840.         SetStreamBufferDirectory ()
  841.  
  842.         1.  Sets the directory where all content is saved, ringbuffer &
  843.             StreamBuffer;
  844.         2.  Creates directory if necessary;
  845.         3.  All TEMP files have hidden+system attributes
  846.     --*/
  847.     HRESULT
  848.     SetDirectory (
  849.         [in]    LPCWSTR pszDirectoryName
  850.         ) ;
  851.  
  852.     /*++
  853.         ------------------------------------------------------------------------
  854.         GetStreamBufferDirectory ()
  855.  
  856.         1.  Retrieves previously set backing store directory, or default
  857.             location if none was specified
  858.     --*/
  859.     HRESULT
  860.     GetDirectory (
  861.         [out]   LPWSTR *    ppszDirectoryName
  862.         ) ;
  863.  
  864.     /*++
  865.         ------------------------------------------------------------------------
  866.         SetBackingFileCount ()
  867.  
  868.         1.  Sets the number of backing files
  869.         2.  valid values
  870.  
  871.                 4 <= min <= 100
  872.                 6 <= max <= 102
  873.                 min max delta >= 2
  874.     --*/
  875.     HRESULT
  876.     SetBackingFileCount (
  877.         [in]    DWORD   dwMin,
  878.         [in]    DWORD   dwMax
  879.         ) ;
  880.  
  881.     /*++
  882.         ------------------------------------------------------------------------
  883.         GetBackingFileCount ()
  884.  
  885.         1.  Retrieves previously set backing file counts, or defaults if none
  886.             have have been set
  887.     --*/
  888.     HRESULT
  889.     GetBackingFileCount (
  890.         [out]   DWORD * pdwMin,
  891.         [out]   DWORD * pdwMax
  892.         ) ;
  893.  
  894.     /*++
  895.         ------------------------------------------------------------------------
  896.         SetEachBackingFileDuration ()
  897.  
  898.         1.  Sets the seconds of content each backing file will hold
  899.         2.  valid values:
  900.  
  901.                 dwSeconds >= 15
  902.     --*/
  903.     HRESULT
  904.     SetBackingFileDuration (
  905.         [in]    DWORD   dwSeconds
  906.         ) ;
  907.  
  908.     /*++
  909.         ------------------------------------------------------------------------
  910.         GetEachBackingFileDuration ()
  911.  
  912.         1.  Retrieves previously set backing file duration, or default of none
  913.             is set
  914.     --*/
  915.     HRESULT
  916.     GetBackingFileDuration (
  917.         [out]   DWORD * pdwSeconds
  918.         ) ;
  919. } ;
  920.  
  921. /*++
  922.     ============================================================================
  923.     ============================================================================
  924.     IStreamBufferMediaSeeking
  925.  
  926.     Implemented on the StreamBufferSource filter.  Used to seek and set the
  927.     playback rate.
  928.  
  929. --*/
  930.  
  931. [
  932.     object,
  933.     uuid(f61f5c26-863d-4afa-b0ba-2f81dc978596),
  934.     pointer_default(unique)
  935. ]
  936. interface IStreamBufferMediaSeeking : IMediaSeeking
  937. {
  938.     //  no additional methods have been added
  939. } ;
  940.  
  941. /*++
  942.     ============================================================================
  943.     ============================================================================
  944.     events
  945. --*/
  946.  
  947. //  see evcode.h comment for range
  948. //  stream buffer engine (PVR)   0x0326 - 0x0350 (sbe.idl)
  949.  
  950. cpp_quote ("#define STREAMBUFFER_EC_BASE                     0x0326")
  951.  
  952. cpp_quote ("enum {")
  953. cpp_quote ("    //  timehole event")
  954. cpp_quote ("    //      param1 = timehole stream offset ms")
  955. cpp_quote ("    //      param1 = timehole size ms")
  956. cpp_quote ("    STREAMBUFFER_EC_TIMEHOLE = STREAMBUFFER_EC_BASE,")
  957. cpp_quote ("    ")
  958. cpp_quote ("    STREAMBUFFER_EC_STALE_DATA_READ,")
  959. cpp_quote ("    ")
  960. cpp_quote ("    STREAMBUFFER_EC_STALE_FILE_DELETED,")
  961. cpp_quote ("    STREAMBUFFER_EC_CONTENT_BECOMING_STALE,")
  962. cpp_quote ("    STREAMBUFFER_EC_WRITE_FAILURE,")
  963. cpp_quote ("    //")
  964. cpp_quote ("    //  unexpected read failure")
  965. cpp_quote ("    //      param1 = HRESULT failure")
  966. cpp_quote ("    //      param2 = undefined")
  967. cpp_quote ("    STREAMBUFFER_EC_READ_FAILURE,")
  968. cpp_quote ("    //")
  969. cpp_quote ("    //  playback rate change")
  970. cpp_quote ("    //      param1 = old_playback_rate * 10000 e.g. 2x is 20000")
  971. cpp_quote ("    //      param2 = new_playback_rate * 10000")
  972. cpp_quote ("    STREAMBUFFER_EC_RATE_CHANGED,")
  973. cpp_quote ("} ;")
  974.  
  975.